package com.aaa.system.controller;


import com.aaa.system.entity.Permission;
import com.aaa.system.entity.User;
import com.aaa.system.entity.UserRole;
import com.aaa.system.service.IPermissionService;
import com.aaa.system.service.IRolePermissionService;
import com.aaa.system.service.IUserRoleService;
import com.aaa.system.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * <p>
 * 权限 前端控制器
 * </p>
 *
 * @author 闫克起
 * @since 2023-06-20
 */
@RestController
@RequestMapping("/system/permission")
public class PermissionController {

    @Autowired
    private IPermissionService permissionService;

    @GetMapping("/left")
    public Result left(HttpSession session){
        //获取当前用户
        User user = (User) session.getAttribute("user");
        List<Permission> permissions=permissionService.findLeftMenuByUserId(user.getId());
        return new Result(200,"查询左侧菜单成功",permissions);
    }
}













